package cn.home.sysmanagement.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.home.sysmanagement.mapper.HomeMedicineMapper;
import cn.home.sysmanagement.domain.HomeMedicine;
import cn.home.sysmanagement.service.IHomeMedicineService;

/**
 * 药品Service业务层处理
 * 
 * @author homedoctor
 * @date 2025-04-09
 */
@Service
public class HomeMedicineServiceImpl implements IHomeMedicineService 
{
    @Autowired
    private HomeMedicineMapper homeMedicineMapper;

    /**
     * 查询药品
     * 
     * @param id 药品主键
     * @return 药品
     */
    @Override
    public HomeMedicine selectHomeMedicineById(Long id)
    {
        return homeMedicineMapper.selectHomeMedicineById(id);
    }

    /**
     * 查询药品列表
     * 
     * @param homeMedicine 药品
     * @return 药品
     */
    @Override
    public List<HomeMedicine> selectHomeMedicineList(HomeMedicine homeMedicine)
    {
        return homeMedicineMapper.selectHomeMedicineList(homeMedicine);
    }

    /**
     * 新增药品
     * 
     * @param homeMedicine 药品
     * @return 结果
     */
    @Override
    public int insertHomeMedicine(HomeMedicine homeMedicine)
    {
        return homeMedicineMapper.insertHomeMedicine(homeMedicine);
    }

    /**
     * 修改药品
     * 
     * @param homeMedicine 药品
     * @return 结果
     */
    @Override
    public int updateHomeMedicine(HomeMedicine homeMedicine)
    {
        return homeMedicineMapper.updateHomeMedicine(homeMedicine);
    }

    /**
     * 批量删除药品
     * 
     * @param ids 需要删除的药品主键
     * @return 结果
     */
    @Override
    public int deleteHomeMedicineByIds(Long[] ids)
    {
        return homeMedicineMapper.deleteHomeMedicineByIds(ids);
    }

    /**
     * 删除药品信息
     * 
     * @param id 药品主键
     * @return 结果
     */
    @Override
    public int deleteHomeMedicineById(Long id)
    {
        return homeMedicineMapper.deleteHomeMedicineById(id);
    }
}
